package BitCreekTracker;

import BitCreekLib.IRMITracker;

import java.rmi.Remote;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.rmi.server.UnicastRemoteObject;


public class Tracker {


    public static void main ( String[] args ) {
        try { /* registrazione presso il registry */

            TrackerServices tracker = new TrackerServices ();
            IRMITracker stub = ( IRMITracker ) UnicastRemoteObject.exportObject ( ( Remote ) tracker, 6900 );
            String name = "RMITracker";
            Registry registry = LocateRegistry.createRegistry ( 6800 );
            registry.bind ( name, stub );
            System.out.println ( "Server ready" );
            TrackerKeepAliveThread tkat = new TrackerKeepAliveThread();
            tkat.run();
        } catch ( Exception e ) {
            e.printStackTrace();
        }

    }

}
